
#写一个函数，求n的阶乘(n是正整数)
def factor(n):
    if n == 1:
        return 1
    return n * factor(n - 1)
result = factor(5)
print(result)





# def factor(n):
#     result = 1
#     for i in range(1,n+1):
#         result *= i
#     return result
#
#
# print(factor(5))


# def factor(n):
#     return n * factor(n - 1)
#
#
# result = factor(5)
# print(result)
